<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="jpath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>添加新闻</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"/>
		<script type="text/javascript">
			window.jQuery || document.write("<script src='${jpath}/static/assets/js/jquery-2.0.3.min.js'>"+"<"+"script>");
		</script>
		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='${jpath}/static/assets/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
		</script>
		<script src="${jpath}/static/assets/js/jquery.mobile.custom.min.js"></script>
		<!-- basic styles -->
		<link href="${jpath}/static/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="${jpath}/static/assets/css/font-awesome.min.css" />

		<link rel="stylesheet" href="${jpath}/static/assets/css/ace.min.css" />
		<link rel="stylesheet" href="${jpath}/static/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="${jpath}/static/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="${jpath}/static/plugins/webuploader/css/webuploader.css" />
		<link rel="stylesheet" href="${jpath}/static/plugins/webuploader/style.css" />

	
		<script src="${jpath}/static/assets/js/ace-extra.min.js"></script>
		<script src="${jpath}/static/plugins/webuploader/dist/webuploader.js"></script>
		<script src="${jpath}/static/plugins/webuploader/upload.js"></script>
		<script type="text/javascript">
			var jpath = "${jpath}";
		</script>
		<script src="${jpath}/js/system_plugins.js"></script>

	</head>

	<body style="background-color: #fff;">
<div class="page-header">
			<h1>
				控制台
				<small>
					<i class="icon-double-angle-right"></i>
					 查看
				</small>
			</h1>
		</div><!-- /.page-header -->
	<div class="row">
		<div class="col-xs-12">
			<form class="form-horizontal" id="stuForm" role="form">
				<div class="form-group">
				<input type="hidden" name="id" id="id" value="${xw.id }" class="col-xs-10 col-sm-5"/>
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">标题 </label>

					<div class="col-sm-9">
						<input type="text" name="bt" id="bt" placeholder="标题" class="col-xs-10 col-sm-5" />
					</div>
				</div>	
				<div class="space-4"></div>	
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-3"> 发表时间 </label>

					<div class="col-sm-9">
						<input type="date" name="fbsj" id="fbsj" class="col-xs-10 col-sm-5" />
					</div>
				</div>	
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 发表人 </label>

					<div class="col-sm-9">
						<input type="text" name="fbr" id="fbr" placeholder="${yhUser.yhxm }" value="${yhUser.id }" disabled="disabled" class="col-xs-10 col-sm-5" />
					</div>
				</div>	
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 新闻内容 </label>

					<div class="col-sm-9">
						<script type="text/javascript" charset="utf-8" src="${jpath}/static/plugins/UEditor/ueditor.config.js"></script>
   						<script type="text/javascript" charset="utf-8" src="${jpath}/static/plugins/UEditor/ueditor.all.min.js"> </script>
						<script type="text/javascript" charset="utf-8" src="${jpath}/static/plugins/UEditor/lang/zh-cn/zh-cn.js"></script>	
						<script id="editor" type="text/plain" style="width:500px;height:300px;"></script>
						<script type="text/javascript">
							var ue = UE.getEditor('editor');
						</script>		
					</div>
				</div>
				<div class="space-4"></div>		
				<div class="form-gr0oup">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-3"> 封面图片</label>
					<div class="col-sm-9">
						<input type="hidden" name="fujianId" id="fujianId" />
						<div id="wrapper" style="width:300px; margin-left:0px;">
					        <div id="container">
					            	<!--头部，相册选择和格式选择-->
					            <div id="uploader">
					                <div class="queueList" style="padding-top:0px;">
					                    <div id="dndArea" class="placeholder">
					                        <div id="filePicker"></div>
					                        <p>或将图片拖到这里</p>
					                    </div>
					                </div>
					                <div class="statusBar" style="display:none;">
					                    <div class="progress">
					                        <span class="text">0%</span>
					                        <span class="percentage"></span>
					                    </div><div class="info"></div>
					                    <div class="btns">
					                        <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
					                    </div>
					                </div>
					            </div>
					        </div>
					    </div>
					 </div>
				</div>	
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 栏目名称 </label>

					<div class="col-sm-9">
						<input type="comboxSelect" name="lmmc" id="lmmc" value="2"
						loadUrl="${jpath}/xinwenlanmu/manager/find"
						parMs="{}"
						 />
						
					</div>
				</div>
				<div class="space-4"></div>		
				
				<div class="clearfix form-actions">
					<div class="col-md-offset-3 col-md-9">
						<button class="btn btn-info" id="subBtn" type="button">
							<i class="icon-ok bigger-110"></i>
							保存
						</button>

						&nbsp; &nbsp; &nbsp;
						<button class="btn" type="reset">
							<i class="icon-undo bigger-110"></i>
							还原
						</button>
						&nbsp; &nbsp; &nbsp;
						<button class="btn" id="bank" type="button">
							<i class="icon-undo bigger-110"></i>
							返回
						</button>
					</div>
				</div>					
			</form>
		</div>
	</div>
	<jsp:include page="getForm.jsp"/>
	<script type="text/javascript">
		//method="post" action="${jpath}/student/manager/add"
	
		$(function(){
			$("#stuForm").loadCombox1();
			$("#subBtn").click(function(){
			if(confirm("确认添加")){
				var contentPar = {};
				var xwnr = UE.getEditor('editor').getContent();
				contentPar.xwnr=xwnr;
				var jsonForms = getForm3("#stuForm");
				var jsonF = $.extend(jsonForms,contentPar);
				$.post("${jpath}/xinwenzixun/manager/addxwzx",jsonF,function(data){
					console.log(data);
					var json = $.parseJSON(data);
					alert(json.resMsg);
				});
				}
			});
			$("#bank").click(function(){
					location.href="${jpath}/xwzxtable";
			});
		});
	</script>
  </body>
</html>
